<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{common/common::common_head(~{::title},~{},~{})}">
	<title>牛客网-关注</title>
</head>
<body>
	<div class="nk-container">
		<!-- 头部 -->
		<header class="bg-dark sticky-top" th:replace="~{common/common::common_header}"></header>

		<!-- 内容 -->
		<div class="main">
			<div class="container">
				<div class="position-relative">
					<!-- 选项 -->
					<ul class="nav nav-tabs mb-3">
						<li class="nav-item">
							<a class="nav-link position-relative active" th:href="@{|/followees/${user.id}|}">
								<i class="text-info" th:utext="${user.username}">Nowcoder</i> 关注的人
							</a>
						</li>
						<li class="nav-item">
							<a class="nav-link position-relative" th:href="@{|/followers/${user.id}|}">关注
								<i class="text-info" th:utext="${user.username}">Nowcoder</i> 的人
							</a>
						</li>
					</ul>
					<a th:href="@{|/user/profile/${user.id}|}" class="text-muted position-absolute rt-0">返回个人主页&gt;</a>
				</div>
				
				<!-- 关注列表 -->
				<ul class="list-unstyled">
					<li class="media pb-3 pt-3 mb-3 border-bottom position-relative" th:each="map: ${users}">
						<a th:href="@{|/user/profile/${map.user.id}|}">
							<img th:src="${map.user.headerUrl}" class="mr-4 rounded-circle user-header" alt="用户头像" >
						</a>
						<div class="media-body">
							<h6 class="mt-0 mb-3">
								<span class="text-success" th:utext="${map.user.username}">落基山脉下的闲人</span>
								<span class="float-right text-muted font-size-12">关注于
									<i th:text="${#dates.format(map.followTime, 'yyyy-MM-dd HH:mm:ss')}">2019-04-28 14:13:25</i>
								</span>
							</h6>
							<div>
								<input type="hidden" id="entityId" th:value="${map.user.id}">
								<button type="button"
										th:class="|btn ${map.hasFollowed?'btn-secondary':'btn-info'} btn-sm float-right follow-btn|"
										th:text="${map.hasFollowed?'已关注':'关注TA'}"
										th:if="${loginUser!=null && loginUser.id != map.user.id}">关注TA
								</button>
							</div>
						</div>
					</li>
				</ul>
				<!-- 分页 -->
				<nav class="mt-5" th:if="${page.rows > 0}" th:replace="~{common/common::common_pahination}"></nav>
			</div>
		</div>

		<!-- 尾部 -->
		<footer class="bg-dark" th:replace="~{common/common::common_footer}"></footer>
	</div>

	<div th:replace="~{common/common::common_js(~{::script})}">
		<script th:src="@{/js/profile.js}"></script>
	</div>
</body>
</html>
